package view.geneticAlgorithmDisplays;

import controller.geneticAlgorithmListeners.NewGenerationListener;
import model.geneticAlgorithm.driver.GeneticAlgorithmDriver;

public class GenerationConsolePrinter implements NewGenerationListener
{

	@Override
	public void matingSeason(GeneticAlgorithmDriver geneticAlgorithm)
	{
		//System.out.println("[Generation #" + geneticAlgorithm.getGeneration() + "] - " + geneticAlgorithm.getPopulation().getBestOrganismsAsStrings());
		System.out.println("[Generation #" + geneticAlgorithm.getGeneration() + "] - Best fitness: " + geneticAlgorithm.getPopulation().getBestOrganisms().iterator().next().calculateFitness() + " for organism: " + geneticAlgorithm.getPopulation().getBestOrganisms().iterator().next().toString() + " \t Worst fitness: " + geneticAlgorithm.getPopulation().getWorstOrganisms().iterator().next().calculateFitness() + " for organism: " + geneticAlgorithm.getPopulation().getWorstOrganisms().iterator().next().toString());

	}

}
